﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;

namespace web01.Controllers
{
    public class ConfigController : Controller
    {
        
        // GET
        public IActionResult Index()
        {
            ConfigurationBuilder configurationBinder = new ConfigurationBuilder();
            configurationBinder.SetBasePath(System.IO.Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json");
           
            var configuration = configurationBinder.Build();
            string connectionString = configuration.GetConnectionString("DefaultDb");
            ViewBag.itvs = connectionString;
            ViewBag.itvss = connectionString;
            return View();
        }
    }
}